<template>
  <div class="cascader">
    <el-select v-model="value" placeholder="请选择性别" :clearable="true">
      <el-option :label="item.value" :value="item.id" v-for="item in sexList" :key="item.key"></el-option>
    </el-select>
  </div>
</template>

<script>
  import { fetchList } from '@/api/web/dictionary'
  export default {
    watch:{
      value(newVal){
        this.$emit('childByValue', newVal)
      }
    },
    data(){
      return{
        value:[],
        sexList:[]
      }
    },
    methods:{

    },
    created(){
      fetchList('sex').then(res=>{
        this.sexList=res.data
      })
    }
  }
</script>

<style scoped>

</style>
